package Server.ServerCore.Controller;

import Server.ServerCore.Model.Player.PlayerInstance;
import Server.ServerCore.Service.DataPacks.packRespose.AllNoBuyIns_response;
import Server.ServerCore.Service.Logic.HandleController;
import Server.ServerCore.Service.Logic.RegisterPack;
import org.jboss.netty.buffer.ChannelBuffer;
import org.springframework.stereotype.Service;

/**
 * @author :石头哥哥<br/>
 *         Project:21Server
 *         Date: 13-4-17
 *         Time: 上午3:21
 *         AllNoBuyInsController==214
 */
@Service
public class AllNoBuyInsController extends HandleController {
    private static final long serialVersionUID = -4643307920961424012L;

    /**
     * 数据分解具体处理的函数
     *
     * @param buffer buffer
     * @param player player
     *
     *
     */
    @Override
    public void DispatchPack(ChannelBuffer buffer, PlayerInstance player) throws Exception {
       //返回开始玩家的位置  2,9
        AllNoBuyIns_response allNoBuyInsResponse=new AllNoBuyIns_response();
        allNoBuyInsResponse.setNextcircleUnitID( player.getCircleUnitIDS().get(0));
        player.DirectSend(allNoBuyInsResponse.getJsonData(2,9));

    }

    /**
     * 通过spring产生处理数据的controller，储存在数组中
     */
    @Override
    public void InitiController() {
        RegisterPack.GAME_CONTROLLERS[214]=this;
    }
}
